import request from '@/utils/request'

// 获取用户登录
export const login = function (data) {
  return request.post('/user/login', data)
}
// 获取用户注册
export const register = function (data) {
  return request.post('/user/registered', data)
}
// 获取的用户信息
export const userMes = function () {
  return request.get('/user')
}
// 更新用户数据
export const updateUser = function (data) {
  return request.patch('/user', data)
}
// 获取轮播图
export const getHome = function () {
  return request.get('/home/swiper')
}
// 获取租房小组
export const getGroups = function () {
  return request.get('/home/groups')
}
// 获取收藏列表
export const getCollectList = function () {
  return request.get('/user/favorites')
}
// 房屋是否收藏
export const updateCollect = function (id) {
  return request.get('/user/favorites/' + id)
}
// 添加收藏
export const addCollect = function (id) {
  return request.post('/user/favorites/' + id)
}
// 删除收藏
export const delCollect = function (id) {
  return request.delete('/user/favorites/' + id)
}
// 发布房源
export const saleHouse = function (data) {
  return request.post('/user/houses', data)
}
